<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery/jquery.min.js"></script>
</head>
<body>
<div>
    <span id="spanceshi">考题类型：</span>
    <select id="selectType">
    <#list list as type>
        <option value="${type.type_id}">${type.type_name}</option>
    </#list>
    </select>
    <span>题库：</span>
    <select name="" id="selectLib">
        <option value="" selected="selected">题库类型</option>
    <#list list1 as lib>
        <option value="${lib.lib_id}" class="p">${lib.lib_name}</option>
    </#list>
    </select>
    <span>知识点：</span>
    <select id="selectPoint">
        <option value="">知识点</option>
    </select>
 <#--   难度等级：<select id="singleGrade">
    <option value="1">简单</option>
    <option value="2">复杂</option>
    <option value="3">困难</option>
</select><br>-->
    <input type="button" value="开始录题" id="btn">
<div>
    <script>
        $("#selectLib").click(function () {
            $.ajax({
                type:'GET',
                dataType:'json',
                url:'/problem/point.do',
                data:{
                    name:$(this).val()
                },
                success:function(result){
                    $("#selectPoint").empty();
                    for(var p in result){
                        $("#selectPoint").prepend("<option value="+result[p].point_id+">"+result[p].point_name+"</option>");
                    }
                },
            });
        });
        $("#btn").click(function () {

            $.ajax({
                type:'GET',
                dataType:'json',
                url:'/problem/foreign.do',
                data:{
                    "type.type_id":$("#selectType").val(),
                    "point.point_id":$("#selectPoint").val(),
                    "teacher.teacher_id":2,
                    "lib.lib_id":$("#selectLib").val()
                },
                success:function () {

                }
            })
        })
    </script>
</body>
</html>